import * as pay from '@/api/pay.js';
const state = {};
const mutations = {};
const getters = {};
const actions = {
	//取消订单
	payIndex({ commit }, payload = {}) {
		return new Promise((resolve, reject) => {
			pay.payIndex(payload).then(res => {
				resolve(res)
			}).catch(err => {
				reject(err)
			})
		})
	},
	//确认收货
	prepay({ commit }, payload = {}) {
		return new Promise((resolve, reject) => {
			pay.prepay(payload).then(res => {
				resolve(res)
			}).catch(err => {
				reject(err)
			})
		})
	},
	//获取订单详情
	payQuery({ commit }, payload = {}) {
		return new Promise((resolve, reject) => {
			pay.payQuery(payload).then(res => {
				resolve(res)
			}).catch(err => {
				reject(err)
			})
		})
	},
	//订单首页
	payRefund({ commit }, payload = {}) {
		return new Promise((resolve, reject) => {
			pay.payRefund(payload).then(res => {
				resolve(res)
			}).catch(err => {
				reject(err)
			})
		})
	},
	//获取银行列表
	bankList({commit},payload={}){
		return new Promise((resolve,reject)=>{
			pay.bankList(payload).then(res=>{
				resolve(res)
			}).catch(err=>{
				reject(err)
			})
		})
	}
};

export default { state, getters, mutations, actions };
